package com.hfy.pcberpbackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hfy.pcberpbackend.entity.Customer;
import com.hfy.pcberpbackend.dto.CustomerQueryDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 客户Mapper接口
 */
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {
    
    /**
     * 分页查询客户列表（包含业务经理姓名）
     */
    IPage<Customer> selectCustomerPage(Page<Customer> page, @Param("query") CustomerQueryDTO query);
    
    /**
     * 检查客户代码是否存在
     */
    int countByCustomerCode(@Param("customerCode") String customerCode, @Param("excludeId") Long excludeId);
} 